package com.share.shareplatform.util;

public class PatternUtil {
    private static String usernamePattern="^[A-Za-z0-9]{3,15}$";
    private static String passwordPattern="^[A-Za-z0-9]{3,15}$";
    private static String phonePattern = "^1[3|4|5|8][0-9]\\d{8}$";

    public static boolean checkUsername(String s){
        return s.matches(usernamePattern);
    }

    public static boolean checkPassword(String s){
        return s.matches(passwordPattern);
    }
    public static boolean checkPhone(String phoneNumber) {
        if (phoneNumber == null || "".equals(phoneNumber))
            return false;

        return phoneNumber.matches(phonePattern);
    }
}
